package com.panshi;

import com.panshi.domain.ArticleVo;
import com.panshi.domain.TypeVo;
import com.panshi.domain.ZxArticle;
import com.panshi.domain.vo.PageBean;
import com.panshi.domain.vo.QueryVO;
import com.panshi.domain.vo.ZxResult;
import com.panshi.vo.R;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

import java.util.List;
import java.util.Map;


@FeignClient(name = "hasbei-zx-service", path = "/api/article", contextId = "IZxArticleApi")
public interface IZxArticleApi {
    /**
     * 资讯首页随机查询资讯
     *
     * @return
     */
    @GetMapping(value = "/articleList")
    List<ArticleVo> articleList();

    /*资讯详情相关推荐*/
    @PostMapping(value = "/articleDetaiRecommendlList")
    List<ArticleVo> articleDetaiRecommendlList(@RequestBody TypeVo typeVo);


    /**
     * 咨询推荐，热点，最新查询
     *
     * @param typeVo
     * @return
     */
    @RequestMapping(value = "/articleListCondition", method = RequestMethod.POST)
    List<ArticleVo> articleListCondition(TypeVo typeVo);

    /**
     * 首页（最新创作）和咨询类型（其它看点）查询
     *
     * @return
     */
    @GetMapping(value = "/articleRandomQuerySix")
    List<ArticleVo> articleRandomQuerySix();

    /**
     * 最新资讯
     * @param pageBean
     * @return
     *//*
    @PostMapping(value ="/zxArticle/newest")
     Map newestArticle(@RequestBody PageBean pageBean);*/

    /**
     * 新增资讯
     *
     * @param zxUncheck
     * @return
     *//*
    @PostMapping(value = "/zxArticle/create")
    ZxResult addZx(@RequestBody ZxUncheck zxUncheck);*/

    /**
     * 根据ID查询分类资讯详情
     *
     * @param id
     * @return
     */
    @GetMapping(value = "/zxTypeBayId/{id}")
    Map<String, Object> zxTypeBayId(@PathVariable("id") Integer id);

    /**
     * 根据ID查询资讯详情(admin)
     *
     * @param id
     * @return
     */
    @GetMapping(value = "/getbayid/{id}")
    R adminZxBayId(@PathVariable("id") Integer id);

    /**
     * 根据ID查询资讯详情
     * @return
     */
    @PostMapping (value = "/zxArticle/getbayid")
    Map ZxBayId(@RequestBody PageBean pageBean);

    /**
     * 全部资讯(admmin)
     *
     * @return
     */
    @PostMapping(value = "/pageZxList")
    R pageZxList(@RequestBody QueryVO queryVO);

    /**
     * 软删除
     * 下架/上架
     *
     * @param zxArticle
     * @return
     */
    @PutMapping(value = "/zxArticle/deleteby")
    R updataStatus(@RequestBody ZxArticle zxArticle);

    /**
     * 根据类型查询资讯
     *
     * @param pageBean
     * @return
     */
    @PostMapping(value = "/zxArticle/zxgettype")
    Map getZxArticleBayType(@RequestBody PageBean pageBean);

    /**
     * 热门资讯
     * @return
     *//*
    @PostMapping(value ="/zxArticle/hot")
     Map hotZxArticle(@RequestBody PageBean pageBean);*/

    /**
     * 大家都在看
     *
     * @return
     */
    @GetMapping(value = "/zxArticle/Look")
    ZxResult everyoneLook();

    /**
     * 专家推荐
     *
     * @return
     */
    @GetMapping(value = "/zxArticle/expert")
    ZxResult expertRecommend();

    /**
     * 查询资讯页类型
     *
     * @return
     */
    @GetMapping(value = "/zxArticle/type")
    ZxResult queryType();

    /**
     * 用户删除
     *
     * @param id
     * @return
     */
    @DeleteMapping("/zxArticle/userdelt/{id}")
    ZxResult userDelete(@PathVariable("id") Integer id);

    /**
     * 用户收藏资讯
     * @param zxArticle
     * @return
     */
    @PostMapping("/zxArticle/addcollect")
    R addCollect(@RequestBody ZxArticle zxArticle);
}
